/*
 * PosInvIndexer.h
 *	Positional Inverted Index
 *
 *  Created on: Oct 23, 2011
 *      Author: zwx
 */
#include "../Include/includes.h"
#include "../Helper/StringHelper.h"
#include "../Helper/FileHelper.h"
using namespace std;

#ifndef POSINVINDEXER_H_
#define POSINVINDEXER_H_

class PosInvIndexer {
public:
	static const int MAX_SIZE_PER_LINE_READ = 1048576;
	static const int INV_INDEX_BARREL_SIZE = 8192;
	static const size_t INFI = 1073741824;
	PosInvIndexer();
	virtual ~PosInvIndexer();
	void makeIndex(string path);
	void writeInvIndex(string path);
	void FlushBuffer(ofstream& out, FileHelper &fh);
	void insertInvMap(size_t docId, size_t offset, fstream& in);
	int getTermID(char* termID, char* line);
	string makeLine(string s1, string s2, string s3, string s4, string s5);
};

#endif /* POSINVINDEXER_H_ */
